import { request } from "@/utils/http";
import { AttrDataList, AttrData } from "./model/attrType";
export default {
  // GET /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
  getAttrInfoList(
    category1Id: number | string,
    category2Id: number | string,
    category3Id: number | string,
  ) {
    return request.get<any, AttrDataList>(
      `/admin/product/attrInfoList/${category1Id}/${category2Id}/${category3Id}`
    );
  },

  // /admin/product/deleteAttr/{attrId}
  // deleteAttr
//   删除单条
  deleteAttr(attrId: number) {
    return request.delete<any, null>(`/admin/product/deleteAttr/${attrId}`);
  },

  // GET /admin/product/getAttrValueList/{attrId}
  // getAttrValueList
  // 获取单条
  getAttrValueList(attrId: number) {
    return request.get<any, AttrData>(`/admin/product/getAttrValueList/${attrId}`);
  },

  // POST /admin/product/saveAttrInfo
  // 保存
  saveAttrInfo(attrData: AttrData) {
    return request.post<any, null>(`/admin/product/saveAttrInfo`, attrData);
  },
};
